package com.xlu.serve.Impl;

import com.xlu.dto.StuDTO;
import com.xlu.entity.StudentEntity;
import com.xlu.mapper.StudentMapper;
import com.xlu.serve.StudentServe;
import com.xlu.vo.StudentVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

@Component
@Service
@Slf4j
public class StudentServeImpl implements StudentServe {
    @Autowired
    private StudentMapper studentMapper;
    @Override
    public List<StudentVo> list(StuDTO studto) {
        StudentEntity studentEntity = new StudentEntity();
        BeanUtils.copyProperties(studto,studentEntity);
        log.info( "{}",studentEntity);

        List<StudentVo> studentVoList = studentMapper.list(studto);
        return studentVoList;
    }
}
